<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* #table{
      border="1" width="600" height="500"
    } */
  </style>
</head>
<body>
  <table id="table" border="1" width="600" height="500">
    <tr>
      <td>单元格1-1</td>
      <td>单元格1-2</td>
      <td>单元格1-3</td>
    </tr>
    <tr>
      <td>单元格2-1</td>
      <td>单元格2-2</td>
      <td>单元格2-3</td>
    </tr>
    <tr>
      <td>单元格3-1</td>
      <td>单元格3-2</td>
      <td>单元格3-3</td>
    </tr>
  </table>

<script>
  const table = document.querySelector('#table');
  table.addEventListener('click', function(e){
    // console.log(e.target.tagName);
    if(e.target.tagName === 'TD'){
      // e.target.innerHTML = `单元格${1}-${1}`
      console.log(e.target.innerHTML);
    
      // document.write( e.target);
    }
  })
</script>



</body>
</html>